package com.hptpd.questionnairesurvey.domain;

import com.hptpd.questionnairesurvey.domain.question.BaseQuestion;
import com.hptpd.questionnairesurvey.domain.question.SingleChoiceQuestion;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * \* Created with IntelliJ IDEA.
 * \* Date: 2019/9/11
 * \*
 * \* Description:
 * \
 *
 * @author walter_long
 */
@Entity
@Table(name = "choice")
@Data
public class Choice {
    @Id
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @GeneratedValue(generator = "uuid")
    @Column(name = "id")
    private String id;

    @Column(name = "description")
    private String description;

    @Column(name = "score")
    private Integer score;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "question_id")
    private BaseQuestion baseQuestion;
}
